#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
struct iny{
	int nu;
	bool can=true;
};
bool comp(iny x,iny y){
	return x.nu<y.nu;
}
int main(){
	int n,c;
	cin>>n>>c;
	iny a[n]; 
	for(int i=0;i<n;i++){
		cin>>a[i].nu;
	}
	sort(a,a+n,comp);
	int count=0;
	int i=0,j=n-1;
	for(int i1=0;i1<n;i1++){
		if(a[j].can==true){
			if(i==j){
				count++;
				break;
			}
			if(a[i].nu+a[j].nu<=c){
				count++;
				a[i].can=false;
				a[j].can=false;
				i++;
				j--;
			}
			else{
				count++;
				a[j].can=false;
				j--;
			}
		}
	}
	cout<<count;
}
